<!--
  @author heguanghua
  @since 2019/06/12 11:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        渠道管理>
        <a lay-href="/channel/list.action">渠道管理</a>>
        <a th:href="'/channel/detail.action?channelId='+${obj.channelId}">[[${obj.name}]]</a>>
        <zmn th:text="服务工程师">服务工程师</zmn>
    </blockquote>

    <div class="layui-card">
        <div th:replace="channel/_tab::tab"></div>

        <fieldset class="layui-elem-field">
            <div class="layui-field-box" style="color: #9F9F9F;">
                有设置此渠道的服务工程师，则该渠道不支持自动派单
            </div>
        </fieldset>

        <form method="POST" class="layui-form" action="/channel/servicemaster/list.action">
            <input type="hidden" name="channelId" th:value="${obj.channelId}"/>
            <input type="hidden" name="addFlag" th:value="${addFlag}"/>
            <div th:replace="channel/servicemaster/_query::query"></div>
        </form>

        <div class="layui-card-body">

            <div th:replace="channel/servicemaster/_table::table"></div>

            <script type="text/html" id="zmn-table-tool">
                <div class="layui-btn-container">
                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/servicemaster/del.action') || (#authPermit.checkPermit('/channel/add.action') && addFlag == '1')}">
                        <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">移除</button>
                    </div>

                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/servicemaster/add.action') || (#authPermit.checkPermit('/channel/add.action') && addFlag == '1')}">
                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="selectWhiteList">+新增白名单</button>
                    </div>

                    <div class="layui-btn-group" th:if="${#authPermit.checkPermit('/channel/servicemaster/add.action') || (#authPermit.checkPermit('/channel/add.action') && addFlag == '1')}">
                        <button class="layui-btn layui-btn-sm layui-btn-primary" lay-event="selectBlackList">+新增黑名单</button>
                    </div>
                </div>
            </script>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/html" id="zmn-table-bar">
    {{#if(json.hasViewDel){ }}
    <a style="color: #00a0e9" lay-event="del">移除</a>&nbsp;&nbsp;
    {{#}}}
</script>

<script type="text/javascript" th:inline="javascript">

    var json = {
        totalCount: [[${query.totalCount}]],
        pageSize: [[${query.pageSize}]],
        pageIndex: [[${query.pageIndex}]],
        query: [[${query}]],
        provinces: [[${provinces}]],
        citys: [[${citys}]],
        provinceId: [[${query.provinceId}]],
        cityId: [[${query.cityId}]],
        channelId: [[${obj.channelId}]],
        hasViewDel: [[${#authPermit.checkPermit('/channel/servicemaster/del.action') || (#authPermit.checkPermit('/channel/add.action') && addFlag == '1')}]],
        addFlag: [[${addFlag}]]
    };

    layui.config({
        base: "/static/lay/",
        version: 201909191616
    }).extend({
        index: "lib/index",
        channel_servicemaster_list: "channel/servicemaster/zmn.plat.channel.servicemaster.list",
    }).use(['index', 'channel_servicemaster_list']);

</script>
